<!--
 * @Author: 曹捷
 * @Date: 2020-06-10 19:34:35
 * @LastEditors: 曹捷
 * @LastEditTime: 2020-09-03 21:23:53
 * @Description: 动态展示 单个动态
--> 
<template>
  <div class="main-content m-t-10 question-content p-t-15">
    <div class="left">
      <obitImage :src="detailsInfo.photoUrl" @click="$app.toUserCenter(detailsInfo.createBy,detailsInfo.realName)" class="headimg" type="user" />
    </div>
    <div class="right p-r-10">
      <div class="q-name flex-l-r">
        <span @click="$app.toUserCenter(detailsInfo.createBy,detailsInfo.realName)" class="obit-link">{{detailsInfo.realName}}</span>
      </div>
      <div @click="toComment" class="back-main obit-info m-b-10 eight-line textarea-info">{{detailsInfo.content}}</div>
      <div class="image-content">
        <image
          :key="'cim'+index"
          :src="item.compressFileUrl"
          @click="$app.toshowImg(index,detailsInfo.fileList)"
          class="question-img"
          v-for="(item,index ) in detailsInfo.fileList"
        />
        <div :key="i" class="question-bak" v-for="i in 2"></div>
      </div>
      <div class="ques-back-foot flex-l-r p-b-15 p-t-5">
        <span class="obit-info">{{detailsInfo.createTime}}</span>
        <slot name="btns"></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    detailsInfo: {
      type: Object,
    },
    // question     focus
    type: {
      type: String,
    },
  },
  data() {
    return {
      hasFocus: false,
    }
  },
  created() {
    this.hasFocus = this.detailsInfo.hasFocus
  },
  methods: {
    toComment() {
      if (this.$listeners.comment) {
        this.$emit('comment')
      } else {
        this.$app.goto('/pages/center/space/spaceDetails', this.detailsInfo)
      }
    },
  },
}
</script>

<style>
</style>